package com.wang.action;

import com.wang.entity.TbTask;
import com.wang.response.ResultResponse;
import com.wang.service.TbTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/task")
public class TbTaskAction {
 @Autowired
    private TbTaskService tbTaskService;

    /*
     添加任务
      */
    @RequestMapping("insertTbTask")
   public ResultResponse insertTbTask(@RequestBody TbTask tbTask){
      return this.tbTaskService.insertTbTask(tbTask);
    }
    /*
     删除任务
     */
    @PostMapping("removetbtask/{taskId}")
    private ResultResponse removetbtask(@PathVariable Integer taskId){
      return this.tbTaskService.removetbtask(taskId);
    }
    /*
    查看任务
     */
    @PostMapping("/findtbtask/{pagenum}/{pagesize}")
    private ResultResponse findtbtask(@PathVariable Integer  pagesize,@PathVariable Integer pagenum){
       return this.tbTaskService.findtbtask(pagenum,pagesize);
    }

//        @PostMapping("/findtbtask")
//    private List<TbTask> findtbtask(){
//       return this.tbTaskService.findtbtask();
//    }
}
